26 October 2017

R to visualize your data

Why visualize your data?


  • summarize information
  • check assumptions validity
  • many pieces of information at one glance
  • ease the understanding

Why use R to do it?

Workflow



         

Why use R to do it?

Workflow



           

Why use R to do it?

Here we'll argue why use R for doing your plots:

  • visualizing data
  • what makes a good graph (some details)
  • work-flow (data are already in R)
  • base graph / ggplot2 / web graphs (interacting)
  • code / reproducible

Why use R to do it?

Many ways to visualize

  • The gridGraphics package
  • Web-based graphs

Why use R to do it?

Why use R to do it?

Why use R to do it?

Few lines of codes

library(raster)
library(mapview)
elvBtn = getData('alt', country='BTN', path='./assets/')
mapview(elvBtn)

Why use R to do it?

Few lines of codes

Why use R to do it?

A large community

Why use R to do it?

Common plots used in meta-analyses with R

What do we want/need to visualize?

Effect size

  • log risk ratios,
  • log odds ratios,
  • mean differences,
  • standardized mean differences,

Number of study

  • by author
  • by region
  • by species

Effect size – Funnel plot

Effect size – Radial plot

Effect size – Forest plot









Vellend et. al 2013

Effect size – Forest plot

Number of Study & effect size

Vellend et al. 2013

Number of Study & geography


Vellend et al. 2013

R packages for meta-analyses

  • click here kev

  • install.packages("ctv"); ctv::install.views("MetaAnalysis")

Meta vs Metafor – support

Meta vs Metafor – workflow

  1. meta:

  2. metafor:

So…

  • Everything you need is online

  • A problem… just google it!

  • How can we help you?

  • click here kev

Install packages

install.packages('metafor')
library('metafor')

rma()

?rma

Funnel plot

Funnel plot

Funnel plot – version 2

Funnel plot – version 3

Forest plot

Custom your plot

Few tips

Few tips

  • Axis
  • Legend
  • points
  • lines
  • colors
  • text

Questions?

Let's practice

Reproduce 2 figures from Vellend et al. 2013



  • Paper is available on line

  • Data available on line as well Dataset S1

Figure 3









Figure S2

Vellend et al. 2013

Let's have some fun

WordCloud

WordCloud

Network of co-authors

igraph

Resources

Useful links

That's all folks